package com.demo.test;

import java.util.*;

public class ReserveDemo {
    public static void main(String[] args) {
        System.out.println(new StringBuilder("i love you").reverse().toString());

        String ss = "i love you";
        List<String> strings = new ArrayList<String>();
        String[] split = ss.split(" ");
        strings = Arrays.asList(split);
        Collections.reverse(strings);
        for(String s : strings){
            System.out.println(s);
        }
    }
}
